package com.millstein.rothn.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private int code;
    private String message;
    private Object data;

    public static Result ok() {
        return new Result(200, "成功", null);
    }

    public static Result ok(Object data) {
        return new Result(200, "成功", data);
    }

    public static Result failure(String message) {
        return new Result(500, message, null);
    }

    public static Result failure(int code, String message) {
        return new Result(code, message, null);
    }

}
